home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-16 | 4.8 KB | 181 lines | [TEXT/KAHL] |
- /******************************************************************************
- x_CMain.cp
-
- CMain Document Class
-
- Copyright © 1996 Dan Crevier. All rights reserved.
-
- Generated by Visual Architectâ„¢ 10:48 AM Sun, Jun 16, 1996
-
- This file is rewritten each time you generate code. You should not
- make changes to this file; changes should go in the CMain.cp
- file, instead.
-
- If you want to change how Visual Architect generates this file, you can
- change the template for this file. It is "_Doc_cp" in the Visual Architect
- Templates folder.
-
- ******************************************************************************/
-
- #include "x_CMain.h"
-
- #include "CMain.h"
-
- #include "MainItems.h"
-
- #include "ViewUtilities.h"
- #include "CApp.h"
-
- #include <CApplication.h>
- #include <CBartender.h>
- #include <Commands.h>
- #include <Constants.h>
- #include <CDecorator.h>
- #include <CDesktop.h>
- #include <CFile.h>
- #include <TBUtilities.h>
- #include <CWindow.h>
-
- extern CApplication *gApplication; /* The application */
- extern CDecorator *gDecorator; /* Decorator for arranging windows */
- extern CDesktop *gDesktop; /* The visible Desktop */
- extern CBartender *gBartender; /* Manages all menus */
-
- #include "CButton.h"
- #include "CVAWASTEText.h"
- #include "CStaticText.h"
- #include "CVAWASTEDlgText.h"
-
- // Define symbols for commands handled by this class
- // Prevents a recompile every time any command changed.
-
-
-
- TCL_DEFINE_CLASS_M1(x_CMain, x_CMain_super);
-
- /**** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ****/
-
-
- /******************************************************************************
- Ix_CMain
-
- Initialize the document
- ******************************************************************************/
-
- void x_CMain::Ix_CMain()
-
- {
- IDocument(gApplication, FALSE);
-
- // Initialize data members below.
- }
-
-
- /******************************************************************************
- MakeNewWindow
-
- Create a new, empty window. Subclass may override to populate
- the new window.
- ******************************************************************************/
-
- void x_CMain::MakeNewWindow(void)
-
- {
- itsWindow = TCLGetNamedWindow("\pMain", this);
-
- itsMainPane = (CPane*) TCLGetItemPointer(itsWindow, 0);
-
- // Initialize pointers to the subpanes in the window
-
- fMain_Butn4 = (CButton*) itsWindow->FindViewByID(kMain_Butn4ID);
- ASSERT(member(fMain_Butn4, CButton));
-
- fMain_TextField = (CVAWASTEText*) itsWindow->FindViewByID(kMain_TextFieldID);
- ASSERT(member(fMain_TextField, CVAWASTEText));
-
- fMain_Stat14 = (CStaticText*) itsWindow->FindViewByID(kMain_Stat14ID);
- ASSERT(member(fMain_Stat14, CStaticText));
-
- fMain_DlgText = (CVAWASTEDlgText*) itsWindow->FindViewByID(kMain_DlgTextID);
- ASSERT(member(fMain_DlgText, CVAWASTEDlgText));
-
- fMain_Stat18 = (CStaticText*) itsWindow->FindViewByID(kMain_Stat18ID);
- ASSERT(member(fMain_Stat18, CStaticText));
-
- }
-
-
- /******************************************************************************
- NewFile {OVERRIDE}
-
- Create and display a new window.
-
- The name of this function is misleading. NewFile leaves
- itsFile NULL. Since this document doesn't use itsFile,
- it remains NULL.
-
- Most of the work is done in MakeNewWindow.
- ******************************************************************************/
-
- void x_CMain::NewFile(void)
-
- {
- Str255 title;
-
- MakeNewWindow(); /* Create window */
- MakeNewContents(); /* And contents */
-
- MakeWindowName(title); /* Set window title */
- itsWindow->SetTitle(title);
-
- itsWindow->Select(); /* Make the front window */
- }
-
-
- /******************************************************************************
- MakeWindowName
-
- Return a name for a new window. The process of forming a
- window name is highly application-dependent. The default function
- returns the file name, if there is a file. Otherwise, the
- window name, if it has a name, otherwise the Untitled string,
- with the decorator's count appended. Note that file names
- do not yield unique window names.
- Subclass may override.
- ******************************************************************************/
-
- void x_CMain::MakeWindowName(
- Str255 newName)
-
- {
- Str31 count;
-
- if (itsFile != NULL)
- itsFile->GetName(newName); /* Return file name */
- else
- {
- /* Append window count to window */
- /* title (from resource) */
- itsWindow->GetTitle(newName);
- if (Length(newName) == 0)
- GetIndString(newName, STRcommon, strUNTITLED);
- NumToString(gDecorator->GetWCount(), count);
- ConcatPStrings(newName, (unsigned char *)"\p ");
- ConcatPStrings(newName, count);
- }
- }
-
-
- /******************************************************************************
- MakeNewContents
-
- Create "blank" document contents. Subclass should override.
- ******************************************************************************/
-
- void x_CMain::MakeNewContents(void)
-
- {
- }
-
-
-